from types import MappingProxyType

from gridplayer.utils.qt import translate

SUBMENUS = MappingProxyType(
    {
        "Jump (to)": {"title": translate("Actions", "Jump (to)"), "icon": "jump-to"},
        "Loop": {"title": translate("Actions", "Loop"), "icon": "loop"},
        "Speed": {"title": translate("Actions", "Speed"), "icon": "speed"},
        "Zoom": {"title": translate("Actions", "Zoom"), "icon": "zoom"},
        "Aspect": {"title": translate("Actions", "Aspect"), "icon": "aspect"},
        "Crop": {"title": translate("Actions", "Crop"), "icon": "crop"},
        "Transform": {"title": translate("Actions", "Transform"), "icon": "rotate"},
        "[ALL]": {"title": translate("Actions", "[ALL]"), "icon": "all"},
        "Grid": {"title": translate("Actions", "Grid"), "icon": "grid"},
        "Seek Sync": {"title": translate("Actions", "Seek Sync"), "icon": "seek-sync"},
        "Seek Others": {
            "title": translate("Actions", "Sync Others"),
            "icon": "seek-sync",
        },
        "Percent": {
            "title": translate("Actions", "Percent"),
            "icon": "seek-sync-percent",
        },
        "Playlist Settings": {
            "title": translate("Actions", "Playlist Settings"),
            "icon": "playlist-settings",
        },
        "Snapshots": {"title": translate("Actions", "Snapshots"), "icon": "snapshots"},
        "Save Snapshot": {"title": translate("Actions", "Save Snapshot")},
        "Delete Snapshot": {"title": translate("Actions", "Delete Snapshot")},
        "Tracks": {"title": translate("Actions", "Tracks"), "icon": "track"},
        "Audio Mode": {
            "title": translate("Actions", "Audio Mode"),
            "icon": "stereo-mode",
        },
        "Add": {"title": translate("Actions", "Add"), "icon": "add"},
        "Playback": {"title": translate("Actions", "Playback"), "icon": "playback"},
        "Audio": {"title": translate("Actions", "Audio"), "icon": "audio"},
        "Video": {"title": translate("Actions", "Video"), "icon": "video"},
    }
)

SECTIONS = MappingProxyType(
    {
        "video_active": [
            "Play / Pause",
            "---",
            "Single Mode ON / OFF",
            "Previous Video",
            "Next Video",
            "---",
            (
                "Audio",
                "Audio Track",
                (
                    "Audio Mode",
                    "Audio Mode - Original",
                    "Audio Mode - Stereo",
                    "Audio Mode - Reverse Stereo",
                    "Audio Mode - Left",
                    "Audio Mode - Right",
                    "Audio Mode - Dolby Surround",
                    "Audio Mode - Headphones",
                    "Audio Mode - Mono",
                ),
                "---",
                "Audio Volume - Increase",
                "Audio Volume - Decrease",
                "Audio Volume - Mute / Unmute",
            ),
            (
                "Video",
                "Video Track",
                (
                    "Zoom",
                    "Zoom In",
                    "Zoom Out",
                    "Zoom Reset",
                ),
                (
                    "Aspect",
                    "Aspect Fit",
                    "Aspect Stretch",
                    "Aspect None",
                ),
                (
                    "Crop",
                    "Crop Left +",
                    "Crop Left -",
                    "Crop Top +",
                    "Crop Top -",
                    "Crop Right +",
                    "Crop Right -",
                    "Crop Bottom +",
                    "Crop Bottom -",
                    "Crop Bottom -",
                    "Crop Reset",
                ),
                (
                    "Transform",
                    "Rotate 90",
                    "Rotate 180",
                    "Rotate 270",
                    "Flip Horizontally",
                    "Flip Vertically",
                    "Transpose",
                    "Anti-transpose",
                    "No Transform",
                ),
            ),
            (
                "Playback",
                "Play Previous File",
                "Play Next File",
                "---",
                (
                    "Jump (to)",
                    (
                        "Percent",
                        "0%",
                        "10%",
                        "20%",
                        "30%",
                        "40%",
                        "50%",
                        "60%",
                        "70%",
                        "80%",
                        "90%",
                    ),
                    "Timecode",
                    "Random",
                    "---",
                    "Next frame",
                    "Previous frame",
                    "---",
                    "+1%",
                    "+5%",
                    "+10%",
                    "-1%",
                    "-5%",
                    "-10%",
                    "---",
                    "+5s",
                    "+15s",
                    "+30s",
                    "-5s",
                    "-15s",
                    "-30s",
                ),
                (
                    "Seek Others",
                    "Seek Others (Percent)",
                    "Seek Others (Timecode)",
                ),
                (
                    "Loop",
                    "Random Loop",
                    "---",
                    "Set Loop Start",
                    "Set Loop End",
                    "Loop Reset",
                    "---",
                    "Repeat Single File",
                    "Repeat Directory",
                    "Repeat Directory (Shuffle)",
                ),
                (
                    "Speed",
                    "Faster",
                    "Slower",
                    "Normal",
                ),
            ),
            "Stream Quality",
            "Rename",
            "Reload",
            "Auto Reload: %v",
            "Close",
        ],
        "video_all": [
            (
                "[ALL]",
                "Play / Pause [ALL]",
                "Play [ALL]",
                "Pause [ALL]",
                "---",
                (
                    "Audio",
                    (
                        "Audio Mode",
                        "Audio Mode - Original [ALL]",
                        "Audio Mode - Stereo [ALL]",
                        "Audio Mode - Reverse Stereo [ALL]",
                        "Audio Mode - Left [ALL]",
                        "Audio Mode - Right [ALL]",
                        "Audio Mode - Dolby Surround [ALL]",
                        "Audio Mode - Headphones [ALL]",
                        "Audio Mode - Mono [ALL]",
                    ),
                    "---",
                    "Audio Volume - Increase [ALL]",
                    "Audio Volume - Decrease [ALL]",
                    "Audio Volume - Mute [ALL]",
                    "Audio Volume - Unmute [ALL]",
                ),
                (
                    "Video",
                    (
                        "Zoom",
                        "Zoom In [ALL]",
                        "Zoom Out [ALL]",
                        "Zoom Reset [ALL]",
                    ),
                    (
                        "Aspect",
                        "Aspect Fit [ALL]",
                        "Aspect Stretch [ALL]",
                        "Aspect None [ALL]",
                    ),
                    (
                        "Crop",
                        "Crop Left + [ALL]",
                        "Crop Left - [ALL]",
                        "Crop Top + [ALL]",
                        "Crop Top - [ALL]",
                        "Crop Right + [ALL]",
                        "Crop Right - [ALL]",
                        "Crop Bottom + [ALL]",
                        "Crop Bottom - [ALL]",
                        "Crop Bottom - [ALL]",
                        "Crop Reset [ALL]",
                    ),
                    (
                        "Transform",
                        "Rotate 90 [ALL]",
                        "Rotate 180 [ALL]",
                        "Rotate 270 [ALL]",
                        "Flip Horizontally [ALL]",
                        "Flip Vertically [ALL]",
                        "Transpose [ALL]",
                        "Anti-transpose [ALL]",
                        "No Transform [ALL]",
                    ),
                ),
                (
                    "Playback",
                    "Play Previous File [ALL]",
                    "Play Next File [ALL]",
                    "---",
                    (
                        "Jump (to)",
                        (
                            "Percent",
                            "0% [ALL]",
                            "10% [ALL]",
                            "20% [ALL]",
                            "30% [ALL]",
                            "40% [ALL]",
                            "50% [ALL]",
                            "60% [ALL]",
                            "70% [ALL]",
                            "80% [ALL]",
                            "90% [ALL]",
                        ),
                        "Timecode [ALL]",
                        "Random [ALL]",
                        "---",
                        "Next frame [ALL]",
                        "Previous frame [ALL]",
                        "---",
                        "+1% [ALL]",
                        "+5% [ALL]",
                        "+10% [ALL]",
                        "-1% [ALL]",
                        "-5% [ALL]",
                        "-10% [ALL]",
                        "---",
                        "+5s [ALL]",
                        "+15s [ALL]",
                        "+30s [ALL]",
                        "-5s [ALL]",
                        "-15s [ALL]",
                        "-30s [ALL]",
                    ),
                    (
                        "Loop",
                        "Random Loop [ALL]",
                        "---",
                        "Set Loop Start [ALL]",
                        "Set Loop End [ALL]",
                        "Loop Reset [ALL]",
                        "---",
                        "Repeat Single File [ALL]",
                        "Repeat Directory [ALL]",
                        "Repeat Directory (Shuffle) [ALL]",
                    ),
                    (
                        "Speed",
                        "Faster [ALL]",
                        "Slower [ALL]",
                        "Normal [ALL]",
                    ),
                ),
                "---",
                "Reload [ALL]",
                "Auto Reload [ALL]",
            ),
            (
                "Seek Sync",
                "Seek Sync (Disabled)",
                "Seek Sync (Percent)",
                "Seek Sync (Timecode)",
            ),
            (
                "Grid",
                "Shuffle Grid",
                "Shuffle Grid On Load",
                "---",
                "Rows First",
                "Columns First",
                "---",
                "Fit Cells",
                "Size: %v",
            ),
            (
                "Snapshots",
                (
                    "Save Snapshot",
                    "Save Snapshot (1)",
                    "Save Snapshot (2)",
                    "Save Snapshot (3)",
                    "Save Snapshot (4)",
                    "Save Snapshot (5)",
                    "Save Snapshot (6)",
                    "Save Snapshot (7)",
                    "Save Snapshot (8)",
                    "Save Snapshot (9)",
                    "Save Snapshot (0)",
                ),
                (
                    "Delete Snapshot",
                    "Delete Snapshot (1)",
                    "Delete Snapshot (2)",
                    "Delete Snapshot (3)",
                    "Delete Snapshot (4)",
                    "Delete Snapshot (5)",
                    "Delete Snapshot (6)",
                    "Delete Snapshot (7)",
                    "Delete Snapshot (8)",
                    "Delete Snapshot (9)",
                    "Delete Snapshot (0)",
                ),
                "Load Snapshot (1)",
                "Load Snapshot (2)",
                "Load Snapshot (3)",
                "Load Snapshot (4)",
                "Load Snapshot (5)",
                "Load Snapshot (6)",
                "Load Snapshot (7)",
                "Load Snapshot (8)",
                "Load Snapshot (9)",
                "Load Snapshot (0)",
            ),
            (
                "Playlist Settings",
                "Disable Click Pause",
                "Disable Wheel Seek",
            ),
        ],
        "program": [
            (
                "Add",
                "Add - Files",
                "Add - URL(s)",
                "Add - Clipboard",
                "Add - Recent Videos",
            ),
            "Open Playlist",
            "Open Playlist (Recent)",
            "Save Playlist",
            "Close Playlist",
            "---",
            "Settings",
            "About",
            "---",
            "Fullscreen",
            "Minimize",
            "Quit",
        ],
    }
)
